package com.qianfeng.job;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
public class MyJob {
   @Scheduled(fixedRate=1000) //每隔一秒调用一次下面的函数
	public void run() {
	   //打印系统时间
	   System.out.println("每个一面执行一次该函数");
		System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
	}
}
